home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP Products & Services 1994 Summer
/
NeXTSTEP Products & Services 1994 Summer.iso
/
AlembicDemo.app
/
Agent
/
finish-installation
< prev
next >
Wrap
Text File
|
1993-09-21
|
2KB
|
72 lines
#!/bin/sh
if [ `whoami` != root ]; then
echo You must be root to run this script!
exit 1
fi
if /bin/grep -s '^[^#]*snmpd' /etc/rc; then
echo Another snmp daemon is already installed. You will need to disable it by
echo commenting out some lines in /etc/rc.
echo
fi
if /bin/grep -s '^[^#]*snmpd' /etc/rc.local; then
if /bin/grep -s '^# Enable Ridgeback snmp daemon. Do not edit this line!$' /etc/rc.local; then
# Enable Ridgeback snmp daemon. Do not edit this line!
# This is probably an upgrade.
echo Ridgeback snmp daemon is already started from /etc/rc.local - no change made.
MODIFY_RC_LOCAL=-NO-
else
echo Another snmp daemon is already installed. You will need to disable it by
echo commenting out some lines in /etc/rc.local.
echo
MODIFY_RC_LOCAL=-YES-
fi
else
# This is probably a fresh installation.
MODIFY_RC_LOCAL=-YES-
fi
if [ $MODIFY_RC_LOCAL = "-YES-" ]; then
echo Backing up /etc/rc.local to /etc/rc.local.oldRS.
# Backup user's /etc/rc.local file to /etc/rc.local.oldRS.
cp -p /etc/rc.local /etc/rc.local.oldRS
echo Modifying /etc/rc.local to start the Ridgeback snmpd automatically on boot up.
# Add lines to rc.local to start snmp daemon automatically on boot up.
cat <<END >> /etc/rc.local
# Enable Ridgeback snmp daemon. Do not edit this line!
if [ -f /private/usr/etc/snmpd -a -f /private/usr/etc/snmp/snmpd.conf ]; then
/private/usr/etc/snmpd /private/usr/etc/snmp/snmpd.conf &
(echo -n ' snmpd') >/dev/console
fi
END
fi
echo
echo Killing any running snmpd\'s.
/bin/kill `ps ax | grep snmpd | grep -v grep | awk '{ print $1 }'` >&- 2>&1
sleep 1
while ps ax | grep snmpd | grep -v grep >&- 2>&1; do
sleep 1;
done
# Do prep run of snmpd to detect run-time errors.
if [ -f /private/usr/etc/snmpd -a -f /private/usr/etc/snmp/snmpd.conf ]; then
/private/usr/etc/snmpd /private/usr/etc/snmp/snmpd.conf&
echo New Ridgeback snmpd launched - checking for errors . . . .
else
echo snmp daemon has not been installed!
exit 1
fi
echo If there are no error messages below, reboot your machine now to use the
echo Ridgeback snmpd!
echo
wait